from sqlalchemy import Column, Integer, String, Float, Date
from sqlalchemy.ext.declarative import declarative_base
from datetime import datetime

Base = declarative_base()

class FeatImp(Base):
    """特征重要性表"""
    __tablename__ = 'feat_imp'
    
    id = Column(Integer, primary_key=True, autoincrement=True)
    model = Column(String(32), nullable=False, comment='模型名称')
    feat = Column(String(32), nullable=False, comment='特征名称')
    imp = Column(Float, nullable=True, comment='特征重要性分数')
    train_dt = Column(Date, nullable=False, comment='训练日期')
    
    def __repr__(self):
        return f"<FeatImp(model='{self.model}', feat='{self.feat}', imp={self.imp})>" 